 
#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<long long> prices(n);
    
    for (int i = 0; i < n; ++i) {
        cin >> prices[i];
    }

    // 使用优先队列来处理价格
    priority_queue<long long> pq;
    for (long long price : prices) {
        pq.push(price);
    }

    // 分配对折券
    for (int i = 0; i < m; ++i) {
        long long maxPrice = pq.top();
        pq.pop();
        pq.push(maxPrice / 2); // 使用一张对折券
    }

    long long totalCost = 0;
    while (!pq.empty()) {
        totalCost += pq.top();
        pq.pop();
    }

    cout << totalCost << endl;
    return 0;
}
